/*
 * traininfo_transfer.h
 *
 *  Created on: 2013-2-14
 *      Author: panqiuhui
 */

#ifndef TRAININFO_TRANSFER_H_
#define TRAININFO_TRANSFER_H_
#include <stdbool.h>
#include "../common_struct/traininfo.h"
#include "../common_struct/stationlist.h"
#include "../common_struct/start_end_stationlist.h"
#include "../common_struct/station_pass_trainlist.h"
#include "../common_struct/ticketlist.h"

//向服务器发送查询车站起售时间的请求并等待回复，查询到结果返回true，否则返回false，结果在station中
bool query_saletime(struct stationinfo *station);

//向服务器发送查询列车经过的车站信息的请求并等待回复，查询到结果返回true，否则返回false，结果在stationlist列表中
bool search_train_number(const struct train_number_request *request,
		StationList *stationlist);

//向服务器发送查询发到站信息的请求并等待回复，查询到结果返回true，否则返回false，结果在start_end_stationlist列表中
bool search_start_end_station(
		const struct train_start_end_station_request *request,
		StartEndStationList *start_end_stationlist);

//向服务器发送查询车站经过车次的请求并等待回复，查询到结果返回true，否则返回false，结果在station_pass_train_list列表中
bool search_station_pass_train(const struct station_pass_train_request *request,
		StationPassTrainList *station_pass_train_list);

//向服务器发送余票查询的请求并等待回复，查询到结果返回true，否则返回false，结果在ticketlist列表中
bool search_ticket_left(const struct ticket_left_request *request,
		TicketList *ticketlist);

//向服务器发送购票请求并等待回复，查询到结果返回true，否则返回false，车票信息存储在ticket中
bool buy_ticket(const struct buy_ticket_request*request,
		struct ticket_saled_info *ticket);

#endif /* TRAININFO_TRANSFER_H_ */
